package com.xpec.c4.game.time;

import java.io.UnsupportedEncodingException;

import com.ms.service.deform.AVT;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;

public class Stamper {

	public static final String KEY = "NjMzNGU3MDI5ZTAxOTQ0NTk5ZGY4MDA0Y2UyNmE5NmY=";
	private static String RK = "";
	private static class SingletonHolder {
		private static final Stamper INSTANCE = new Stamper();
	}

	private Stamper() {
		Init();
	}

	public static final Stamper getInstance() {
		return SingletonHolder.INSTANCE;
	}
	
	private void Init()
	{
		//
		try {
			RK = new String(Base64.decode(KEY),"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public String Save(String keyPoint)
	{
		AVT save = new AVT(RK);
		return save.EnAvt(keyPoint);
	}
	
	public String Reduction(String keyPoint)
	
	{	AVT reduction = new AVT(RK);
		String reductionString = null;
		try {
			reductionString = reduction.DeAvt(keyPoint);
		} catch (Exception e) {
			
		}
		return reductionString;
	}
}
